#!/usr/bin/env bash
# shellcheck disable=SC2261
# shellcheck disable=SC2210
nohup scrapyd > scrapyd.log &
# shellcheck disable=SC2034
# shellcheck disable=SC2009


#git pushd https://github.com/LittltU/LittltU.git

scrapydPid=$(ps -ef | grep scrapyd | grep -v grep | awk '{print $2}')
if [ ! "$scrapydPid" ]; then
  echo "scrapyd process is not exist"
else
  echo "scrapyd start Field .."
fi

mkdir spideradmin
# shellcheck disable=SC2164
cd spideradmin

spideradmin init

nohup spideradmin > spideradmin.log &

# shellcheck disable=SC2009
spiderAdminPid=$(ps -ef | grep spideradmin | grep -v grep | awk '{print $2}')

if [ ! "$spiderAdminPid" ]; then
  echo "spiderAdmin process is not exist"
else
  echo "spiderAdmin is running"
fi

echo "server start over"